package com.hdy.redislikerankinglist.utils;

import com.hdy.redislikerankinglist.pojo.RestResponse;

public class ResultGenerator {
    public static  RestResponse genSuccessResult(String code,String message) {
        RestResponse response= new RestResponse();
        response.setSuccess(true);
        response.setCode(code);
        response.setMessage(message);
        return response;
    }
    public static <T> RestResponse genSuccessResult(T data) {
        RestResponse<T> response= new RestResponse();
                response.setCode("200");
                response.setSuccess(true);
                response.setData(data);
        return response;
    }
}
